﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core;

namespace COFE.Helpers.Subclasses
{
    public class Path
    {

        /// <summary>
        /// Make temp path for virtual item, this is just relative path, combine with UserProfile.TempPath.
        /// </summary>
        /// <param name="rootParseName"></param>
        /// <param name="relPath"></param>
        /// <returns></returns>
        public string MakeTempPath(string rootParseName, string relPath)
        {
            return COFEPath.MakeTempPath(rootParseName, relPath);
        }

        /// <summary>
        /// Convert volume key (e.g. TEMP) and parseName (Arch3.7z) to a full parsable name (e.g. {TEMP}\arch3.7z) 
        /// </summary>
        /// <param name="listerKey"></param>
        /// <param name="parseName"></param>
        /// <returns></returns>
        public string FormatFullParseName(string listerKey, string parseName)
        {
            return COFEPath.FormatFullParseName(listerKey, parseName);
        }



        /// <summary>
        /// Convert full parsable name (e.g. {TEMP}\arch3.7z) to volume key (e.g. TEMP) and parseName (Arch3.7z).
        /// </summary>
        /// <param name="fullParsePath"></param>
        /// <param name="key"></param>
        /// <param name="parsePath"></param>
        /// <returns></returns>
        public bool ParseFullParseName(string fullParsePath, out string key, out string parsePath)
        {
            return COFEPath.ParseFullParseName(fullParsePath, out key, out parsePath);
        }

        public string GetListerKeyFromFullParseName(string fullParsePath)
        {
            return COFEPath.GetListerKeyFromFullParseName(fullParsePath);
        }

        public string GetParsePathFromFullParseName(string fullParsePath)
        {
            return COFEPath.GetParsePathFromFullParseName(fullParsePath);
        }

        public string GetDirectoryName(string path)
        {
            return COFEPath.GetDirectoryName(path);
        }

        public string GetFileName(string path)
        {
            return COFEPath.GetFileName(path);
        }

        public string GetExtension(string path)
        {
            return COFEPath.GetExtension(path);
        }

        public string ChangeExtension(string path, string extension)
        {
            return COFEPath.ChangeExtension(path, extension);
        }

        public string RemoveExtension(string path)
        {
            return COFEPath.RemoveExtension(path);
        }

        /// <summary>
        /// Combine two path strings
        /// </summary>
        /// <param name="path1"></param>
        /// <param name="path2"></param>
        /// <returns></returns>
        public string Combine(string path1, string path2)
        {
            return COFEPath.Combine(path1, path2);
        }
    }
}
